import { useState } from "react";

import Child from "./Child";
import Son from "./Son";

function App() {
  const [person, setPerson] = useState({ name: "jack", age: 18 });

  const [user] = useState({ name: "jack", age: 18, sex: 1, address: "宏福苑" });

  return (
    <div>
      App...
      {/* 1. 父组件给子组件传递 props 数据：以标签属性方式传递数据 */}
      <Child name={person.name} age={person.age} />
      {/* 这种写法相当于下面的写法 */}
      <Son {...user} />
      {/* <Son name={user.name} age={user.age} sex={user.sex} address={user.address} /> */}
    </div>
  );
}

export default App;
